{template file="member/header.html"/}
<div class="layui-card pd-20 no-shadow">
    <div class="layui-card-header fly-title">
        <h2>我的稿件</h2>
    </div>
    <div class="layui-card-body">
        <table class="layui-hide" id="currentTable" lay-filter="currentTable"></table>
    </div>
</div>
<script type="text/html" id="barTool">
    <a href='{:url("edit")}?id={{ d.id }}' class="layui-btn layui-btn-xs">编辑</a>
    <a href='{:url("del")}?id={{ d.id }}' class="layui-btn layui-btn-danger layui-btn-xs layui-tr-del">删除</a>
</script>
<script type="text/html" id="status">
    {{#  if(d.status==-1){ }}
<button class="layui-btn layui-btn-danger layui-btn layui-btn-xs">已退稿</button>
    {{#  } else if(d.status==0){ }}
<button class="layui-btn layui-btn-danger layui-btn layui-btn-xs">待审核</button>
    {{#  } else if(d.status==1){ }}
<button class="layui-btn layui-btn layui-btn-xs">已通过</button>
    {{#  } }}
</script>
{template file="member/layui.html"/}
<script>
layui.use(['yznTable'], function() {
    var table = layui.table,
        $ = layui.$,
        form = layui.form;

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTable',
        edit_url: '{:url("edit")}',
        delete_url: '{:url("del")}',
    };

    yznTable.render({
        init: init,
        toolbar: ['refresh'],
        url: '{:url("published")}',
        search: false,
        cols: [
            [
                { field: 'id', width: 60, title: 'ID' },
                { field: 'title', title: '标题' },
                { field: 'catname', width: 120, title: '所属栏目' },
                { field: 'create_time', width: 180, title: '发布时间' },
                { field: 'url', width: 60, align: "center", title: 'URL', templet: yznTable.formatter.url },
                { field: 'status', width: 90, align: "center", title: '状态', templet: '#status' },
                { fixed: 'right', width: 120, title: '操作', toolbar: '#barTool' }
            ]
        ],
        page: {}
    });

    yznTable.bindevent();

});
</script>
{template file="member/footer.html"/}